package com.stedu.test;

import com.stedu.config.MainConfig;
import com.stedu.mapper.AdminMapper;
import com.stedu.mapper.CharactersMapper;
import com.stedu.mapper.GamesMapper;
import com.stedu.mapper.TestMapper;
import com.stedu.service.AdminService;
import com.stedu.service.GamesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = "classpath:beans.xml")
@ContextConfiguration(classes = MainConfig.class)
public class MyTest3 {
    @Autowired
    private AdminMapper adminMapper;
    @Autowired
    private AdminService adminService;
    @Autowired
    private CharactersMapper charactersMapper;
    @Autowired
    private GamesMapper gamesMapper;
    @Autowired
    private GamesService gamesService;
    @Autowired
    private TestMapper testMapper;

    @Test
    public void test1() {
        //List<Map<String, Object>> maps = adminMapper.selectPlaAndGamas();
        //int updatepassword = adminMapper.updatepassword("root", "root");
        //System.out.println(updatepassword);
        //
        //maps.stream().forEach(System.out::println);
        ////int addcharacters = charactersMapper.addcharacters(new Characters(null, "2", 1, 3));
        ////System.out.println(addcharacters);
        //gamesMapper.selectrevenue().stream().forEach(System.out::println);
        gamesMapper.selectAll("A","1").forEach(System.out::println);
        charactersMapper.selectall(null,null).forEach(System.out::println);
        //Games games = gamesMapper.selectByEid(9l);
        //System.out.println(games);
        //gamesService.selecyAll(null, null).forEach(System.out::println);
        //gamesService.delete(43L);
        testMapper.selectchoice("2", "a").stream().forEach(System.out::println);
        System.out.println(adminService.uppassword("root", "root"));

    }
}
